﻿<Window x:Class="MvvmFx.Samples.HowTos.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Views1="clr-namespace:MvvmFx.Samples.HowTos.ChangeTracking.Views"
    xmlns:ViewModels2="clr-namespace:MvvmFx.Samples.HowTos.PropertyHandlers.ViewModels"
    xmlns:PropertyRehandlers1="clr-namespace:MvvmFx.Samples.HowTos.PropertyRehandlers"
    xmlns:Validation1="clr-namespace:MvvmFx.Samples.HowTos.Validation"
    xmlns:ViewModels3="clr-namespace:MvvmFx.Samples.HowTos.ChangeTracking.ViewModels"
    xmlns:Views="clr-namespace:MvvmFx.Samples.HowTos.PropertyHandlers.Views"
    Title="MVVM How To's"
    Width="800" Height="600" 
    WindowStartupLocation="CenterScreen">

    <Window.Resources>

        <DataTemplate DataType="{x:Type Validation1:DeliveryViewModel}">
            <Validation1:DeliveryView/>
        </DataTemplate>

        <DataTemplate DataType="{x:Type ViewModels2:PropertyHandlersViewModel}">
            <Views:PropertyHandlersView/>
        </DataTemplate>

        <DataTemplate DataType="{x:Type ViewModels3:ContactDetailsViewModel}">
            <Views1:ContactDetailsView />
        </DataTemplate>

        <DataTemplate DataType="{x:Type PropertyRehandlers1:BoolViewModel}">
            <PropertyRehandlers1:BoolView />
        </DataTemplate>
      
    </Window.Resources>

    <Grid>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <DockPanel>

    		<TextBlock Text="How To.." FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center" DockPanel.Dock="Top"/>
    		<ListBox 
    			ItemsSource="{Binding HowTos}"
    			DisplayMemberPath="Key"
    			IsSynchronizedWithCurrentItem="True"
    			SelectedValue="{Binding SelectedHowTo}"
                />
    	</DockPanel>

        <ContentControl Grid.Column="1"
                        Content="{Binding SelectedHowTo}" Margin="10"
                        />
        

    </Grid>

</Window>
